-- 2012-05-17 EM .

alter procedure sp_get_phone_by_login
	@login varchar(50),
	@uid int output,
	@phone varchar(21) output
as
begin
	set nocount on;
	
exec sms_p.dbo.prints 'GPBL 000','sp_get_phone_by_login', @login,32
	

EXEC	dbproc.[dbo].[sp_get_phone_by_identificator_codes]
		@code_a = 'login',
		@code_b = @login,
		@uid = @uid output,
		@phone = @phone OUTPUT

exec sms_p.dbo.prints 'GPBL 020','uid', @uid,32
exec sms_p.dbo.prints 'GPBL 021','Phone', @phone,32
	
	end;
go

grant execute on sp_get_phone_by_login to Executer;

/*

DECLARE	@return_value int,
		@uid int,
		@phone varchar(21)

EXEC	@return_value = [dbo].[sp_get_phone_by_login]
		@login = N'irinasot',
			@uid = @uid OUTPUT,
		@phone = @phone OUTPUT

SELECT	@uid as N'@uid',
		@phone as N'@phone'

SELECT	'Return Value' = @return_value

*/